<?php

namespace Biz\model\brand;

/**
 * 品牌内容池
 * Class Content
 * @package Biz\model\brand
 */
class BrandUserPenalty extends \Doraemon\pockets\datebase\BaseDbModel
{
    const _CONFIG_FILE_ = 'db_store';

    const _CONFIG_SELECT_ = 'db_store';

    const _DATABASE_ = 'store';

    const _TABLE_NAME = 'brand_user_penalty';

    // 用户类型
    const USER_COMMON = 0;  //普通用户
    const AUTH_USER_BRAND = 1;  //品牌用户
    const AUTH_USER_DESIGNER = 2;  //设计师用户
    const AUTH_USER_V = 3; // 个人V认证
    const AUTH_USER_UNAUTH_DESIGNER = 4;//未认证设计师
    const AUTH_ORG_V = 5; // 机构V认证
    const AUTH_DECO_COMPANY = 6; // 装修公司
    const AUTH_USER_EXAMPLE = 10;//居住榜样用户 取消此类型
    const AUTH_USER_STORE = 11;//门店用户


    // 状态 封禁8、冻结9、禁言3、禁评4
    const STATUS_BLOCKED = 1;//封禁
    const STATUS_FROZEN = 1;//冻结
    const STATUS_STOP_COMMENT = 1;// 禁评

    const NORMAL = 0;
    const B1 = 10;
    const B2 = 9;
    const B3 = 11;
    const XL = 2;

    /*
     @desc : 添加一条记录
     * */
    public static function add($data)
    {
        $data['addtime'] = time();
        $ret = self::insert($data);
        if ($ret->errorCode() !== '00000') {
            return false;
        }
        return self::id();
    }

    public static function updateByWhere($where ,  $data)
    {
        return self::update($data , $where);
    }

    public static function getListByWhere($where , $field = '*')
    {
        return self::select($field ,$where);
    }


    public static function getListByUid($uid , $field = '*')
    {
        return self::get($field ,['uid' => $uid]);
    }


    public static function geCountNum($where)
    {
        return self::count($where);
    }
}